From 63f6aca1cf33572867ab5f8cd73bfeaed83e4244 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 24 May 2019 00:31:07 +0000 Subject: [PATCH] fishbowl: Add a menubutton demo This reveals some issues with the position tracking. --- demos/gtk-demo/fishbowl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/demos/gtk-demo/fishbowl.c b/demos/gtk-demo/fishbowl.c index d2f0c399a7..6a1ad923a0 100644 --- a/demos/gtk-demo/fishbowl.c +++ b/demos/gtk-demo/fishbowl.c @@ -164,6 +164,19 @@ create_switch (void) return w; } +static GtkWidget * +create_menu_button (void) +{ + GtkWidget *w = gtk_menu_button_new (); + GtkWidget *popover = gtk_popover_new (NULL); + + gtk_container_add (GTK_CONTAINER (popover), gtk_button_new_with_label ("Hey!")); + gtk_menu_button_set_popover (GTK_MENU_BUTTON (w), popover); + gtk_menu_button_popup (GTK_MENU_BUTTON (w)); + + return w; +} + static const struct { const char *name; GtkWidget * (*create_func) (void); @@ -179,6 +192,7 @@ static const struct { { "Video", create_video }, { "Gears", create_gears }, { "Switch", create_switch }, + { "Menubutton", create_menu_button }, }; static int selected_widget_type = -1; -- 2.30.2